package com.wom.blocks;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Rectangle;

import com.wom.worldmaker.GameProperties;


public abstract class AbstractBlock extends Rectangle {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int xPos;
	private int yPos;
	public  int[] id={-1,-1};
	private String name="";
	private boolean visible;
	private Color color;
	





	public AbstractBlock(int xPos, int yPos) {
		super();
		this.xPos = xPos;
		this.yPos = yPos;
		this.visible=true;
		setBounds(getxPos()*GameProperties.blockSize, getyPos()*GameProperties.blockSize, GameProperties.blockSize, GameProperties.blockSize);
		
		
		
	}


	public void setBlockPosition(int x,int y){


		// check boundaries first....
		setxPos(x);
		setyPos(y);
		setName(toString());
	}


	/**
	 * @return the yPos
	 */
	public int getyPos() {
		return yPos;
	}


	/**
	 * @param yPos the yPos to set
	 */
	public void setyPos(int yPos) {
		this.yPos = yPos;
	}


	/**
	 * @return the xPos
	 */
	public int getxPos() {
		return xPos;
	}


	/**
	 * @param xPos the xPos to set
	 */
	public void setxPos(int xPos) {
		this.xPos = xPos;
	}


	/**
	 * @return the id
	 */
	public int[] getId() {
		return id;
	}


	/**
	 * @param id the id to set
	 */
	public void setId(int[] id) {
		this.id = id;
	}





	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}


	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}


	/**
	 * @return the visible
	 */
	public boolean isVisible() {
		return visible;
	}


	/**
	 * @param visible the visible to set
	 */
	public void setVisible(boolean visible) {
		this.visible = visible;
	}

	public abstract void renderBlock(Graphics g);
	public abstract void updateBlock();


	/**
	 * @return the color
	 */
	public Color getColor() {
		return color;
	}


	/**
	 * @param color the color to set
	 */
	public void setColor(Color color) {
		this.color = color;
	}




	
	
	
	


}

